import java.util.ArrayList;
import java.util.Collections;

public class Test {
    public static void main(String[] args) {
        ArrayList<Student> arrayList = new ArrayList<>();
        Student student1 = new Student("zhangsan",18,85);
        Student student2 = new Student("wangwu",18,66);
        Student student3 = new Student("zhaoliu",18,77);
        arrayList.add(student1);
        arrayList.add(student2);
        arrayList.add(student3);
        for (Student s:arrayList) {
            System.out.println(s);
        }
        Collections.sort(arrayList);
        for (Student s:arrayList) {
            System.out.println(s);
        }
    }
}
